import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const router = new VueRouter({
  mode: "history",
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: "/login",
      name: "Login",
      component: () => import("../pages/login"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/register",
      name: "Register",
      component: () => import("../pages/register"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/home",
      name: "Home",
      component: () => import("../pages/home"),
      meta: {
        showFooter: true,
      },
    },
    {
      path: "/detail/:id",
      name: "Detail",
      component: () => import("../pages/detail"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/fenlei",
      name: "Fenlei",
      component: () => import("../pages/fenlei"),
      meta: {
        showFooter: true,
      },
    },
    {
      path: "/cart",
      name: "Cart",
      component: () => import("../pages/cart"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/mine",
      name: "Mine",
      component: () => import("../pages/mine"),
      meta: {
        showFooter: true,
      },
    },
    {
      path: "/order",
      name: "Order",
      component: () => import("../pages/order"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/address",
      name: "Address",
      component: () => import("../pages/address"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/showaddress",
      name: "Showaddress",
      component: () => import("../pages/showaddress"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/editaddress/:id",
      name: "Editaddress",
      component: () => import("../pages/editaddress"),
      meta: {
        showFooter: false,
      },
    },
    {
      path: "/orderdetail/:id",
      name: "Orderdetail",
      component: () => import("../pages/orderdetail"),
      meta: {
        showFooter: false,
      },
    },
  ],
});
export default router;
